// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
var db = cloud.database({
  env: "zousonglin1992-n4jsc"
})
// 云函数入口函数
exports.main = async(event, context) => {
  const wxContext = cloud.getWXContext()
  const openid = wxContext.OPENID
  const _ = db.command
  var getSms = db.collection('sms-record').where({
    openid: _.eq(openid)
  }).get()
  return getSms
}